home *** CD-ROM | disk | FTP | other *** search
/ The Scorpion King Cardz / The Scorpion King Cardz - Disc 1 - Mathays.iso / pc / Mathayus.exe / Mathayus.dxr / 00004_ChangeDisplaySetting.ls < prev    next >
Encoding:
Text File  |  2002-03-26  |  1.7 KB  |  52 lines

  1. on ChangeDisplaySetting
  2.   global gOrigScreenDisplay, gCurrentScreenDisplay
  3.   gOrigScreenDisplay = []
  4.   gOrigScreenDisplay = dosGetDisplay()
  5.   put "gOrigScreenDisplay = " & gOrigScreenDisplay
  6.   modeFound = 0
  7.   i = 1
  8.   repeat while not modeFound
  9.     gCurrentScreenDisplay = dosGetDisplayMode(i)
  10.     i = i + 1
  11.     if gCurrentScreenDisplay = VOID then
  12.       exit
  13.     end if
  14.     if ilk(gCurrentScreenDisplay, #list) = 0 then
  15.       exit
  16.     end if
  17.     if gCurrentScreenDisplay = [] then
  18.       exit repeat
  19.     end if
  20.     if gCurrentScreenDisplay[1] = 800 then
  21.       if (gCurrentScreenDisplay[4] > 55) or (gCurrentScreenDisplay[4] = 0) then
  22.         bitTarget = 32
  23.         repeat while bitTarget > 8
  24.           testDepth = dosSetDisplay(gCurrentScreenDisplay[1], gCurrentScreenDisplay[2], bitTarget, gCurrentScreenDisplay[4], "Test")
  25.           if testDepth then
  26.             gCurrentScreenDisplay[3] = bitTarget
  27.             modeFound = 1
  28.             exit repeat
  29.             next repeat
  30.           end if
  31.           bitTarget = bitTarget - 8
  32.         end repeat
  33.         if modeFound then
  34.           exit repeat
  35.         end if
  36.       end if
  37.     end if
  38.   end repeat
  39.   if not modeFound then
  40.     put "No compatible display mode was found on the system."
  41.     exit
  42.   end if
  43.   x1 = dosSetDisplay(gCurrentScreenDisplay[1], gCurrentScreenDisplay[2], gCurrentScreenDisplay[3], gCurrentScreenDisplay[4], "Test")
  44.   if x1 then
  45.     Success = dosSetDisplay(gCurrentScreenDisplay[1], gCurrentScreenDisplay[2], gCurrentScreenDisplay[3], gCurrentScreenDisplay[4], "Temporary")
  46.   end if
  47.   if not Success then
  48.     put "Can't set the display setting, error # " & dosGetLastError()
  49.   end if
  50.   put "gCurrentScreenDisplay = " & gCurrentScreenDisplay
  51. end
  52.